package com.cbts.entity;

import java.sql.Timestamp;
import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * ExchangeRecordId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class ExchangeRecordId implements java.io.Serializable {

	// Fields

	private Timestamp exchangeTime;
	private String userid;

	// Constructors

	/** default constructor */
	public ExchangeRecordId() {
	}

	/** full constructor */
	public ExchangeRecordId(Timestamp exchangeTime, String userid) {
		this.exchangeTime = exchangeTime;
		this.userid = userid;
	}

	// Property accessors

	@Column(name = "exchangeTime", nullable = false, length = 19)
	public Timestamp getExchangeTime() {
		return this.exchangeTime;
	}

	public void setExchangeTime(Timestamp exchangeTime) {
		this.exchangeTime = exchangeTime;
	}

	@Column(name = "userid", nullable = false, length = 15)
	public String getUserid() {
		return this.userid;
	}

	public void setUserid(String userid) {
		this.userid = userid;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof ExchangeRecordId))
			return false;
		ExchangeRecordId castOther = (ExchangeRecordId) other;

		return ((this.getExchangeTime() == castOther.getExchangeTime()) || (this
				.getExchangeTime() != null
				&& castOther.getExchangeTime() != null && this
				.getExchangeTime().equals(castOther.getExchangeTime())))
				&& ((this.getUserid() == castOther.getUserid()) || (this
						.getUserid() != null && castOther.getUserid() != null && this
						.getUserid().equals(castOther.getUserid())));
	}

	public int hashCode() {
		int result = 17;

		result = 37
				* result
				+ (getExchangeTime() == null ? 0 : this.getExchangeTime()
						.hashCode());
		result = 37 * result
				+ (getUserid() == null ? 0 : this.getUserid().hashCode());
		return result;
	}

}